package cn.tedu.boot04.controller;

import cn.tedu.boot04.entity.Product;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AxiosController {
    @RequestMapping("/helloAxios")
    public String helloAxios(String name,String age){
        return "测试成功:name="+name+"age="+age;
    }

    @RequestMapping("/postAxios")
    public String postAxios(@RequestBody Product product){
        return "post成功:"+product.getId()+","+product.getTitle()
                +","+product.getPrice()+","+product.getNum()+",全"+product.toString();
    }
}
